package uvt.gui.mainframe.object.menuitem;

import javax.swing.JCheckBoxMenuItem;

import uvt.gui.mainframe.object.command.Command;
import uvt.map.PositionsSettings;
import uvt.map.ShowElement;

public class ShowGraphMenuItem extends JCheckBoxMenuItem implements Command {
	
    public ShowGraphMenuItem() {
		super("Show Graph",false);
	}
	
	public void execute() {
		if(this.isSelected()) {
			ShowElement.showGraph(PositionsSettings.getInstance().getMap());
		} else {
			PositionsSettings.getInstance().cleanMap();
		}
	}
	
}
